﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevCow.Mashups;


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MashupManager mm = new MashupManager(@"C:\Mashup");

        //Get the block from the mashup manager
        MashupBlock bi1 = mm.GetBlock("NameDateArrayBlock2");
        MashupBlock bi2 = mm.GetBlock("BirthdayBlock");

        //Create a new mashup
        Mashup myMashup = new Mashup();

        //add a mashup connection
        MashupBlockConnection conn = myMashup.AddConnection(bi1, "MyArray").AddConnection(bi2, "Birthday");
        conn.AddMapper("name", "NameDateArrayBlock2", "FirstName");
        conn.AddMapper("date", "NameDateArrayBlock2", "Birthdate");

        //execute the mashup
        myMashup.output = this.Response.Output;
        myMashup.ExecuteMashup();

        GridView1.DataSource = myMashup.LastDataSource;
        GridView1.DataBind();
    }
}

